<template>
  <div id="app">
    <!-- 使用common组件 -->
    <common v-if="Boolean(tokenStr)">
      <div slot="mains">
        <!-- 页面渲染 -->
        <router-view></router-view>
      </div>
    </common>
    <div v-if="!Boolean(tokenStr)">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
// 引入common组件
import Common from "./components/Common.vue";
export default {

  data() {
    return { tokenStr: window.sessionStorage.getItem("token") };
  },
  components: {
    methods: {},
    common: Common,
  },
};
</script>


<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  font-size: 16px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
</style>